import java.awt.*;
import javax.swing.tree.*;
import hypertree.*;

@SuppressWarnings("serial")
public class NoeudHyperArbre 
       extends DefaultMutableTreeNode 
       implements HTNode
{
	private int type;

	public final static  int _DEFAUT      = 1;
	public final static  int _FAIT        = 2;
	public final static  int _MESURE      = 3;
	public final static  int _DIMENSION   = 4;
	public final static  int _HIERARCHIE  = 5;
	public final static  int _PARAMETRE   = 6;
	public final static  int _ATTR_FAIBLE = 7;

	public NoeudHyperArbre(String v, int t) 
	{
		super(v);
		this.type = t;
	}

	public Color getColor()
	{
		switch (this.type)
		{
			case _DEFAUT      : { return new Color(255,255,255); }
			case _FAIT        : { return new Color(90,220,90);   }
			case _MESURE      : { return new Color(90,220,90);   }
			case _DIMENSION   : { return new Color(255,90,90);   }  
			case _HIERARCHIE  : { return new Color(255,150,0);   }
			case _PARAMETRE   : { return new Color(255,255,0);   }
			case _ATTR_FAIBLE : { return new Color(255,210,0);   }
		}
		return Color.RED;
	}

	public String getName()
	{
		return this.toString();
	}
}
